#define _CRT_SECURE_NO_WARNINGS 1

int removeElement(int* nums, int numsSize, int val) {
    int copy = 0;
    int paste = 0;
    for (copy = 0; copy < numsSize; copy++)
    {
        if (nums[copy] != val)
        {
            nums[paste] = nums[copy];
            paste++;
        }
    }
    return paste;
}